#include "board.h"


static vu16 Adv_Vref;
static vu16 Adv_Ch0;
static u8 Now_Cont = 0;

static void AdcDone(u16 adv);

void Board_Init()
{
    Gpio_Init();
    Adc_Init();
    Adc_StartScan(AdcDone);
}


// ADC 转换完毕事件
static void AdcDone(u16 adv)
{
    switch(Now_Cont)
    {
    case 0:
        Adv_Ch0 = adv;
        Now_Cont = 1;
        break;
    case 1:
        Adv_Vref = adv;
        Now_Cont = 0;
        Adc_StartScan(AdcDone);
        break;
    }
}

